{% extends '::admin.html.twig' %} 
{% block title %}
    Администраторская часть
{% endblock %}
{% block javascripts %}
  {{ parent() }}
{% endblock %}
{% block body %}
<h1>Firms edit</h1>

<form action="{{ path('admin_firms_update', { 'id': entity.id }) }}" method="post" {{ form_enctype(edit_form) }}>
    <div class="form_fieldset">
      {{ form_label(edit_form.name) }}
      {{ form_widget(edit_form.name, {'attr': {'class': 'text' } }) }}
    </div>
    <div class="form_fieldset">
      {{ form_label(edit_form.description) }}
      {{ form_widget(edit_form.description, {'attr': {'class': 'tinymce', 'tinymce': '{"theme":"simple"}' } }) }}
    </div>
    <div class="form_fieldset">
      {{ form_label(edit_form.category) }}
      {{ form_widget(edit_form.category, {'attr': {'class': 'text' } }) }}
    <a href="{{ path('admin_category') }}">Редактировать категорию</a>
    </div>
    <div class="form_fieldset">
      {{ form_label(edit_form.user) }}
      {{ form_widget(edit_form.user, {'attr': {'class': 'text' } }) }}
      <a href="{{ path('admin_user_edit',{'id': entity.user.id}) }}">Редактировать пользователя</a>
    </div>
      {{ form_rest(edit_form) }}
    <p>
        <button type="submit">Редактировать</button>
    </p>
</form>

<ul class="record_actions">
    <li>
        <a href="{{ path('admin_firms') }}">
            Back to the list
        </a>
    </li>
    <li>
        <a href="{{ path('admin_staff', {'firm_id': entity.id}) }}">
            Товар фирмы
        </a>
    </li>
    <li>
        <form action="{{ path('admin_firms_delete', { 'id': entity.id }) }}" method="post">
            {{ form_widget(delete_form) }}
            <button type="submit">Delete</button>
        </form>
    </li>
</ul>
{% endblock %}
{% block post_javascripts %}
    {{ parent()}}
    {{ tinymce_init() }}
{% endblock %}